package com.whfc.mach.dao;

import com.whfc.mach.dto.maintain.MaintainItemDTO;
import com.whfc.mach.entity.AppMachMaintainItem;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppMachMaintainItemMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMachMaintainItem record);

    int insertSelective(AppMachMaintainItem record);

    AppMachMaintainItem selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMachMaintainItem record);

    int updateByPrimaryKey(AppMachMaintainItem record);

    /**
     * 根据保养id集合查找
     *
     * @param maintainIds
     * @return
     */
    List<MaintainItemDTO> selectByMaintainIds(@Param("maintainIds") List<Integer> maintainIds);

    /**
     * 根据保养id查找
     *
     * @param maintainId
     * @return
     */
    List<MaintainItemDTO> selectByMaintainId(@Param("maintainId") Integer maintainId);

    /**
     * 批量插入
     *
     * @param maintainId
     * @param itemList
     */
    void batchInsert(@Param("maintainId") Integer maintainId, @Param("itemList") List<MaintainItemDTO> itemList);

    /**
     * 逻辑删除
     *
     * @param maintainId
     */
    void deleteLogic(@Param("maintainId") Integer maintainId);
}